A critical part of rendering images is computing the shading of samples. Typically, shading is done in one of two ways, either by using a “shading language” or a “shading network”.
A shading language (such as Renderman™) is a form of scripting or a programming language that is specifically designed to compute shading. The inputs from each sample are fixed based on the geometry type, and all the texturing, lighting and other effects are integrated into a comprehensive shading program. In such systems, different shaders are used for different types of outputs. For example, different shaders may be provided for displacement and for final color. Unfortunately, these sort of shading languages can be hard to use, especially for non-technical artists.
A shading network is a system that presents a more graphical user interface for constructing shaders. A “DAG” (directed acyclic graph), also known as a “node system”, is used to represent a shading network. In these systems, the final node is usually a lighting model, and all the different nodes that output to that node can come from nodes that output compatible value types, like scalars or colors. The geometric parameters from the sample are the inputs to the network. Unfortunately, shading node networks can be complex to specify and to modify.
Another problem with these existing systems is that they are limited in terms of the inputs available. For example, shading typically involves setting values based on input parameters such as position and UV from surfaces. In addition, existing shading systems operate differently for different output types. As a result, existing shading systems typically employ different shaders for different processes to process surfaces for rendering. For example, displacement typically happens before scan-conversion so the displacement shader is typically evaluated first with a subset of the inputs that a final-color shader would have. Therefore, any shared components between these two shaders would have to be managed by the user. Again, this results in excessive complexity for the user.